package view.ui
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	public class ProgressBar extends Sprite
	{
		[Embed(source="asset/red.png")]
		private var _red_jpg:Class;
		private var red_jpg:Bitmap;
		
		
		[Embed(source="asset/green.png")]
		private var _green_jpg:Class;
		private var green_jpg:Bitmap;
		
		
		[Embed(source="asset/black.png")]
		private var _black_jpg:Class;
		private var black_jpg:Bitmap;
		
		public function ProgressBar()
		{
			super();
		}
		
		
		public function red():void
		{
			if(black_jpg)
			{
				black_jpg.visible=false;
			}
			if(green_jpg)
			{
				green_jpg.visible=false;
			}
			if(!red_jpg)
			{
				red_jpg=new _red_jpg() as Bitmap;
				this.addChild(red_jpg);
			}
			
			red_jpg.visible=true;
		}
		
		public function green():void
		{
			if(!green_jpg)
			{
				green_jpg=new _green_jpg() as Bitmap;
				this.addChild(green_jpg);
			}
			green_jpg.visible=true;
			if(black_jpg)
			{
				black_jpg.visible=false;
			}
			if(red_jpg)
			{
				red_jpg.visible=false;
			}
		}
		
		public function black():void
		{
			if(!black_jpg)
			{
				black_jpg=new _black_jpg() as Bitmap;
				this.addChild(black_jpg);
			}
			black_jpg.visible=true;
			if(red_jpg)
			{
				red_jpg.visible=false;
			}
			if(green_jpg)
			{
				green_jpg.visible=false;
			}
		}
		
	}
}